//
//  ForgotPassViewController.m
//  HdMovie
//
//  Created by Classic on 1/8/13.
//  Copyright (c) 2013 Hoang tuan. All rights reserved.
//

#import "ForgotPassViewController.h"

@interface ForgotPassViewController ()

@end

@implementation ForgotPassViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    UIView *paddingView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)];
    _txtFldEmail.leftView = paddingView;
    _txtFldEmail.leftViewMode = UITextFieldViewModeAlways;
    UIView *paddingView2 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 20)];
    _txtFldUserName.leftView = paddingView2;
    _txtFldUserName.leftViewMode = UITextFieldViewModeAlways;
    _txtFldUserName.delegate = self;
    _txtFldEmail.delegate = self;
    [paddingView release];
    [paddingView2 release];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
    [textField resignFirstResponder];
    return NO;
}

- (void)dealloc {
    [_txtFldUserName release];
    [_txtFldEmail release];
    [super dealloc];
}
- (void)viewDidUnload {
    [self setTxtFldUserName:nil];
    [self setTxtFldEmail:nil];
    [super viewDidUnload];
}
- (IBAction)forgotClick:(id)sender {
    if (_txtFldUserName.text.length <= 0) {
        [self showAlert:@"Tên tài khoản không được để trống"];
    }else if (_txtFldEmail.text.length <= 0){
        [self showAlert:@"Email không được để trống"];
    }else{
    //action when click btn dong y
    }
}

- (IBAction)backClick:(id)sender {
    [self.navigationController popViewControllerAnimated:YES];
}

-(void)showAlert:(NSString *)message
    {
        UIAlertView *alMessErr = [[UIAlertView alloc] initWithTitle:@"Error" message:message delegate:nil cancelButtonTitle:@"Đồng Ý" otherButtonTitles:nil, nil];
        [alMessErr show];
}
@end
